package com.qlk.odcinterface.dao.impl;

import com.qlk.common.dao.mybatis.BaseDao;
import com.qlk.odcinterface.dao.PmsCouponChannelDao;
import com.qlk.odcinterface.domain.PmsCouponChannel;
import com.qlk.odcinterface.domain.query.PmsCouponChannelQuery;

import java.util.List;
import org.springframework.stereotype.Repository;

/**
 * PmsCouponChannelDAO实现类<br/>
 * 对'满减促销渠道对应表'表进行基本的操作
 * 
 * @author zhaoyanan
 * @version 2016-4-14 14:11:36
 * 
 */
@Repository
public class PmsCouponChannelDaoImpl extends BaseDao implements PmsCouponChannelDao {
    /** namespace */
    private final String namespace = PmsCouponChannelDaoImpl.class.getName();
    
    /**
     * {@inheritDoc}
     */
    public List<PmsCouponChannel> queryPmsCouponChannelList(PmsCouponChannelQuery queryBean) {
        return (List<PmsCouponChannel>) queryForList(namespace +".queryPmsCouponChannelList", queryBean);
    }

    /**
     * {@inheritDoc}
     */
    public boolean insert(PmsCouponChannel pmsCouponChannel) {
        return insert(namespace +".insert", pmsCouponChannel);
    }

    /**
     * {@inheritDoc}
     */
    public boolean update(PmsCouponChannel pmsCouponChannel) {
        return update(namespace +".update", pmsCouponChannel);
    }

    /**
     * {@inheritDoc}
     */
    public int queryPmsCouponChannelCount(PmsCouponChannelQuery queryBean) {
        return (Integer) queryForObject(namespace +".queryPmsCouponChannelCount", queryBean);
    }

    /**
     * {@inheritDoc}
     */
    public List<PmsCouponChannel> queryPmsCouponChannelListWithPage(PmsCouponChannelQuery queryBean) {
        return (List<PmsCouponChannel>) queryForList(namespace +".queryPmsCouponChannelListWithPage", queryBean);
    }

    /**
     * {@inheritDoc}
     */
    public boolean delete(PmsCouponChannel configuration) {
        return delete(namespace +".delete", configuration);
    }

    /**
     * {@inheritDoc}
     */
    public PmsCouponChannel getPmsCouponChannelById(Integer id) {
        return (PmsCouponChannel) queryForObject(namespace +".getPmsCouponChannelById", id);
    } 
    
    /**
     * {@inheritDoc}
     */
    public boolean exist(PmsCouponChannel pmsCouponChannel) {
        int count = (Integer) queryForObject(namespace +".exist", pmsCouponChannel);
        return count > 0;
    }
}
